package com.ngkj.zmfptback.sys.controller;

import com.ngkj.zmfptback.sys.service.read.SystemService;
import com.ngkj.zmfptCommon.common.bean.CommonReslut;
import com.ngkj.zmfptCommon.common.util.ResultEnum;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @author ChenHN
 * @since 2021/10/26 creation
 **/
@RestController
public class SystemController {

    @Resource
    private SystemService systemService;



    @ResponseBody
    @GetMapping("/getDictsData")
    public <T> CommonReslut<T> getDictsData(){
        try {
            Map<String, List<Map<String, Object>>> data = systemService.getDictsData();
            CommonReslut<T> mapCommonReslut = (CommonReslut<T>) new CommonReslut<>(ResultEnum.ok, data);
            return mapCommonReslut;
        }catch (Exception e){
            e.printStackTrace();
            return new CommonReslut<T>(ResultEnum.error);
        }
    }

}
